 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server.logic;


/**
 *
 * @author TuyetNgan
 */
public interface ServerLogicInterface {
    /**
     * Split a file into pieces depend on FILE_SIZE 
     * 
     * @return PIECE_SIZE
     */
    public int choosePiecesSize();
    
    /**
     * Number of pieces in file depends on FILE_SIZE
     * 
     * @param FILE_SIZE
     * @param PIECE_SIZE
     * @return Amount of pieces
     */
    public int getNumberOfPiece(long FILE_SIZE, int PIECE_SIZE);
    
      
    /**
     * Check in Database if piece exists
     * 
     * @param FILE_ID
     * @param PIECE_ID
     * @return TRUE if piece exists, FALSE if none 
     */
    public Boolean checkPieceInDatabase(String FILE_ID, String PIECE_ID);
    
    /**
     * Check in LocalFile if piece exists
     * 
     * @param FILE_ID
     * @param PIECE_ID
     * @return TRUE if piece exists, FALSE if none 
     */
    public Boolean checkPieceInLocalFile(String FILE_ID, String PIECE_ID);
    
    
}
